package com.liu.demo.order;

import com.liu.demo.order.config.OrderConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author liujiazhong
 */
@RestController
@SpringBootApplication
@EnableConfigurationProperties({OrderConfig.class})
public class OrderApplication {

    private final OrderConfig orderConfig;

    public OrderApplication(OrderConfig orderConfig) {
        this.orderConfig = orderConfig;
    }

    @GetMapping("orderInfo")
    public String info() {
        return orderConfig.getInfo();
    }

    public static void main(String[] args) {
        SpringApplication.run(OrderApplication.class, args);
    }

}
